<include file="Public/head"/>
<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <div class="cf">
                            <form class="form-inline" action="" method="get">
                                <label class="inline">支付状态</label>
                                <select name="status" class="form-control">
                                    <option value="">--全部--</option>
                                    <option value="-1" <if condition="$status eq -1">selected</if>>--待支付--</option>
                                    <option value="1" <if condition="$status eq 1">selected</if>>--已提交--</option>
                                    <option value="2" <if condition="$status eq 2">selected</if>>--已支付--</option>
                                </select>
                                <label class="inline">支付方式</label>
                                <select name="pay_id" class="form-control">
                                    <option value="">--全部--</option>
                                    <volist name="pay_type_list" id="vo">
                                    <option value="{$vo.id}" <if condition="$pay_id eq $vo['id']">selected</if>>--{$vo.name}--</option>
                                    </volist>
                                </select>
                                <label class="inline">支付日期</label>
                            	<input class="form-control" id="pay_date" name="pay_date" value="{:I('pay_date')}"/>
                                <label class="inline">关键字</label>
                                <input type="text" name="keyword" value="{:I('keyword')}" style="width:220px;" placeholder="订单编号、购买人" class="form-control">
                                <button type="submit" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    搜索
                                </button>
                            </form>
                        </div>
                        <div class="space-4"></div>
                            <table class="table table-striped table-bordered" id="dowebok">
                                <thead>
                                <tr>
                                    <th>订单编号</th>
                                    <th>订单金额</th>
                                    <th class="<if condition="$field eq 'nickname'">sorting_{$sort}<else/>sorting</if> sort_tag" field="nickname">购买人</th>
                                    <th>会员等级</th>
                                    <th>状态</th>
                                    <th>提交时间</th>
                                    <th class="<if condition="$field eq 'pay_id'">sorting_{$sort}<else/>sorting</if> sort_tag" field="pay_id">支付方式</th>
                                    <th class="<if condition="$field eq 't'">sorting_{$sort}<else/>sorting</if> sort_tag" field="t">支付时间</th>
                                    <th>操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <empty name="list">
                                	<tr>
                                		<td colspan="10" style="text-align:center;">暂时没有数据</td>
                                	</tr>
                                <else/>
                                	<volist name="list" id="vo">
                                    <tr>
                                        <td>{$vo['order_no']}</td>
                                        <td>{$vo['money']}</td>
                                        <td>{$vo['nickname']}</td>
                                        <td>{$vo['level']}</td>
                                        <td>
                                        	<if condition="$vo['status'] eq 2">已支付</if>
                                        	<if condition="$vo['status'] eq 1">已提交</if>
                                        	<if condition="$vo['status'] eq 0">待支付</if>
                                        </td>
                                        <td>{$vo.t|date='Y-m-d H:i:s',###}</td>
                                        <td>{$vo.pay_name}</td>
                                        <td><if condition="$vo['status'] eq 2">{$vo.finish_t|date='Y-m-d H:i:s',###}</if></td>
                                        <td><a href="{:U('update',array('id'=>$vo['id'],'p'=>$p))}">查看</a>
                                        </td>
                                    </tr>
                                </volist>
                                </empty>
                                </tbody>
                            </table>
                            {$page}
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script src="__PUBLIC__/qwadmin/js/date-time/bootstrap-datepicker.js"></script>
<script type="text/javascript">
$(function(){
	$('#pay_date').datepicker({
        format: 'yyyy-mm-dd',
        weekStart: 1,
        autoclose: true,
        todayBtn: 'linked',
        language: 'cn'
    });
    //table排序
	$(".sort_tag").each(function(){
		var th = $(this),thIndex = th.index(),inverse = true;
		th.click(function(){
			var tag = $(this).attr("class");
			tag = tag.substring(0,tag.indexOf(" "));
			if(tag=='sorting_asc'){
				sortTable($(this).attr("field"),"desc");
			}else if(tag=='sorting_desc'){
				sortTable($(this).attr("field"),"asc");
			}else if(tag=='sorting'){
				sortTable($(this).attr("field"),"asc");
			}
			
		});
	});

});

function sortTable(field,sort){
	var pay_id = "{$pay_id}";
	var pay_date = "{:I('pay_date')}";
	var status = "{$status}";
	var keyword = "{:I('keyword')}";
	location.href = "{:U('index')}?field="+field+"&sort="+sort+"&pay_id="+pay_id+"&pay_date="+pay_date+"&status="+status+"&keyword="+keyword;
}
</script>
</body>
</html>
